# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="library to create FLV video streams for use with Flash/SWF movies."
HOMEPAGE="http://klaus.geekserver.net/libflv"
SRC_URI="http://mesh.dl.sourceforge.net/sourceforge/libflv/libflv.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="examples"

DEPEND=""
RDEPEND=""

S=${WORKDIR}/${PN}

src_compile() {
	cd src
	emake CFLAGS="-I. -fPIC" || die "emake failed"
	if use examples ; then
		cd ${S}/examples/capture	
		emake 
		cd ${S}/examples/dump
		emake CFLAGS="-I../../src -fPIC"
	fi
}

src_install() {
	if use examples ; then
		exeinto /usr/share/${P}/examples
			doexe examples/capture/capture
			doexe examples/dump/dump
	fi
	cd src
	dolib ${PN}.so
	insinto /usr/include
		doins ${PN}.h
}
